package main

import "fmt"

func main() {
	// s, t := "abc", "ahbgdc"
	s, t := "axc", "ahbgdc"
	v := isSubsequence(s, t)
	fmt.Println(v)
}

func isSubsequence(s string, t string) bool {
	t1 := 0
	for i := 0; i < len(s); i++ {
		if t1 >= len(t) {
			return false
		}

		if t[t1] == s[i] {
			t1++
			continue
		} else {
			for {
				if t1 < len(t)-1 {
					t1++
				} else {
					return false
				}

				if s[i] == t[t1] {
					t1++
					break
				}
			}
		}
	}
	return true
}
